<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::middleware('auth:api')->get('/user', function (Request $request) {
    return $request->user();
});

// 上传图片链接
Route::post('upload/image','Api\CommonController@uploadImage');


Route::group(['namespace'=>'Api'],function(){

  Route::group(['prefix'=>'test','namespace'=>'Test'], function () {
    Route::post('index', 'TestController@index' );
  });


  // 模仿住范儿
  Route::group(['prefix'=>'zhufaner','namespace'=>'Zhufaner'], function () {
    Route::post('index', 'IndexController@index' );
  });


  // 鸡尾酒
  Route::group(['prefix' => 'cocktail','namespace'=>'Cocktail'], function () {

    // 文章列表
    Route::group(['prefix' => 'aticle'], function () {
      Route::post('add', 'ArticleController@add' );
      Route::post('edit/{id}', 'ArticleController@edit' );

      // 小程序用到的
      Route::post('list', 'ArticleController@list' );
      Route::post('show/{id}', 'ArticleController@show' );
      Route::post('search', 'ArticleController@search' );

    });
    


  });

  
});

